package com.dou.controller;

import com.dou.entity.Dev_User;
import com.dou.service.Dev_UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller//作用 接受客户请求 调用service方法 返回给客户
public class UserController {
    @Autowired
    private Dev_UserService dev_userService;
    //用户登录
    @RequestMapping("LoginUser.action")
    public String LoginUser(Model model, String devCode, String Password){
        Dev_User dev_user = dev_userService.LoginUser(devCode,Password);
        if(dev_user==null){
            return "login";
        }else {
            model.addAttribute("dev_user",dev_user);
            return "DevUser/index";
        }
    }
    //

}
